import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import layout from '@/layout/index'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component : layout,
    children:[
      {
        path:'',
        name:'home',
        component: HomeView
      }
    ]
  },
  {
    path: '/user/list',
    component : layout,
    children:[
      {
        path:'',
        name:'user-list',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/list.vue')
      }
    ]
  },
  {
    path:'/role',
    component:layout,
    children:[
      {
        path: 'list',
        name: 'role-list',
        component:()=>import('../views/role/list.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
